package com.njtoyo.taxi.admin.rest.controller.business;

import cn.hutool.core.lang.Dict;
import com.njtoyo.taxi.admin.service.business.PassengerRefundService;
import com.njtoyo.taxi.entity.backend.AdminUser;
import com.taxi.entity.common.RestResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("finance/passenger-refund")
@RequiredArgsConstructor
@Slf4j
public class PassengerRefundController {
    @Autowired
    private PassengerRefundService passengerRefundService;


    @GetMapping("/orderDetail/{keyword}")
    public RestResult orderDetail(@PathVariable("keyword") String keyword) {
        return passengerRefundService.getOrderDetail(keyword);
    }

    @PostMapping("/refund")
    public RestResult refund(@RequestBody Dict dict, @ModelAttribute("admin") AdminUser adminUser) {
        return passengerRefundService.refund(dict, adminUser);
    }


}
